<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--view 层-->
<div id="app">
    <todo>
        <todo-title slot="todo-title" :titles="title"></todo-title>
        <todo-items slot="todo-items" v-for="items in todoItems" v-bind:item="items"></todo-items>
    </todo>

</div>
<script src="vue.js"></script>
<script>
    //slot插槽
    Vue.component("todo",{
        template: '<div>\
                        <slot name="todo-title"></slot>\
                        <ul>\
                            <slot name="todo-items"></slot>\
                        </ul>\
                   </div>'
    });
    Vue.component("todo-title",{
        props:['titles'],
        template: '<div>{{titles}}</div>'

    });
    Vue.component("todo-items",{
        props: ['item'],
        template: '<li>{{item}}</li>'

    });
    var vm=new Vue({
        el: "#app",
        data: {
            title:"cljh列表",
            todoItems:['cljh学java','cljh学前端','cljh学Linux']
        }

    });
</script>
</body>
</html>